package com.neuedu.homework;

import java.util.Calendar;

public class ColaEmployee {
    //成员变量
    private String empName;
    private int empBirthdayMonth;

    //行为方法


    public String getEmpName() {
        return empName;
    }

    public void setEmpName(String empName) {
        this.empName = empName;
    }

    public int getEmpBirthdayMonth() {
        return empBirthdayMonth;
    }

    public void setEmpBirthdayMonth(int empBirthdayMonth) {
        this.empBirthdayMonth = empBirthdayMonth;
    }

    /**
     * getSalary(int month) 根据参数月份来确定工资，如果该月员工过生日，则公司会额外奖励100元
     * @param month 当前月份
     * @return 返回生日奖励工资
     */
    public double getSalary(int month){
        //工资
        double mysalary=0.0;

        /*Calendar cal = Calendar.getInstance();
         month = cal.get(Calendar.MONTH) + 1;*/
        //计算员工生日金
        if (month==this.empBirthdayMonth){
            //获得生日金
            mysalary+=100;
        }
        return mysalary;
    }

    public void printMySalary(int month){
        System.out.println("员工姓名："+this.getEmpName()+",工资"+getSalary(month));
    }

    //自定义构造方法
    public ColaEmployee(String empName,int empBirthdayMonth){
        super();
        this.empName=empName;
        this.empBirthdayMonth=empBirthdayMonth;
    }

    //显示写出的默认构造方法
    public ColaEmployee(){

    }

}
